package com.yt.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Classname Gateway9500Config
 * @Description
 * @Date 2021/10/22 18:12
 * @Create by 杨涛
 */
@Configuration
public class Gateway9500Config {
    //https://gitee.com/progit/
    @Bean
    public RouteLocator consumerRouteLocator(RouteLocatorBuilder routeLocatorBuilder){
        RouteLocatorBuilder.Builder routes=routeLocatorBuilder.routes();
        //对应uri的跳转路径访问当前端口的http://127.0.0.1:9500/progit/
        //可以跳转到uri
        routes.route("gitee",route -> route.path("/progit/")
                .uri("https://gitee.com/progit/")  );
        return routes.build();
    }
}
